package cn.erperp.cdc.maxwell.rowmapper;

import cn.erperp.cdc.maxwell.entity.BusEventsApiWaitAckEntity;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class MessageWaitAckRowMapper implements RowMapper<BusEventsApiWaitAckEntity> {
    @Override
    public BusEventsApiWaitAckEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
        BusEventsApiWaitAckEntity busEventsApiEntity = new BusEventsApiWaitAckEntity();
        busEventsApiEntity.setId(rs.getLong("id"));
        busEventsApiEntity.setMqType(rs.getString("mq_type"));
        busEventsApiEntity.setMqJson(rs.getString("mq_json"));
        busEventsApiEntity.setClassName(rs.getString("class_name"));
        busEventsApiEntity.setEventJson(rs.getString("event_json"));
        busEventsApiEntity.setUserToken(rs.getString("user_token"));
        busEventsApiEntity.setCreatedDate(rs.getTimestamp("created_date"));
        busEventsApiEntity.setCreatingOwner(rs.getString("creating_owner"));
        busEventsApiEntity.setProcessingOwner(rs.getString("processing_owner"));
        busEventsApiEntity.setProcessingAvailableDate(rs.getTimestamp("processing_available_date"));
        busEventsApiEntity.setProcessingState(rs.getString("processing_state"));
        busEventsApiEntity.setErrorCount(rs.getInt("error_count"));
        busEventsApiEntity.setSearchKey1(rs.getLong("search_key1"));
        busEventsApiEntity.setSearchKey2(rs.getLong("search_key2"));
        return busEventsApiEntity;
    }
}
